package dk.i2m.converge.core.search;

import java.io.File;
import org.apache.solr.common.SolrInputDocument;

/**
 * Interface describing a {@link File} indexer for the {@link IndexingFactory}.
 *
 * @author Allan Lykke Christensen
 */
public interface Indexer {

    /**
     * Processes the given {@link File} and returns a {@link SolrInputDocument}
     * representing the index of the {@link File}.
     *
     * @param file
     *          {@link File} to index
     * @param mimeType
     *          MIME type detected for the file
     * @return {@link SolrInputDocument} representing the index of the given
     *         {@link File}
     * @throws dk.i2m.converge.core.search.CannotIndexException
     *          If the {@link File} could not be indexed
     */
    SolrInputDocument index(File file, String mimeType) throws CannotIndexException;
}

